{include file="./header"  title="权限列表" /}
<div class="container-fluid">
  <div class="btn-group" role="group" aria-label="Basic example">
    <a href="{:url('action_add')}" class="btn btn-primary">添加</a>
    {notempty name="$sql"}
    <a href="{:url('action')}" class="btn btn-primary">返回上级</a>
    {/notempty}
  </div>
<br /><br />
<table width="100%"  class="table table-striped table-hover">
  <thead>
  <tr>
    <th>#</th>
    <th>名称</th>
    <th>参数</th>
    <th>参数</th>
    <th>参数</th>
    <th>状态</th>
    <th>操作</th>
  </tr>
  </thead>
  {foreach name="list" item="val"}
  <tr>
    <td>{$val.id}</td>
    <td>{$val.name|default=''}</td>
    <td>{$val.module|default='全部'}</td>
    <td>{$val.controller|default='全部'}</td>
    <td>{$val.action|default='全部'}</td>
    <td>{$val['status']==1?'开启':'关闭'}</td>
    <td>
    	{eq name="$val.pid" value="0"}
    	<a class="btn btn-primary" href="{:url('?pid='.$val['id'])}" role="button">下级权限</a>
        {/eq}
        <a class="btn btn-primary" href="{:url('Member/action_edit?id='.$val['id'])}" role="button">编辑</a>
        <a class="btn btn-primary" href="{:url('Member/action_delete?id='.$val['id'])}" role="button">删除</a>
    </td>
  </tr>
  {/foreach}
  
</table>
{$page}
</div>
{include file="./footer" /}
